package com.shujia.java.day21;

import com.shujia.java.day14.ListToMapDemo1.Student;
import com.sun.xml.internal.ws.api.pipe.ServerTubeAssemblerContext;

public class test {
    public static void main(String[] args) {
        StringBuffer a = new StringBuffer("A");
        StringBuffer b = new StringBuffer("B");
        operate(a, b);
        System.out.println(a + "," + b);
    }

    static void operate(StringBuffer x, StringBuffer y) {
        //兩個引用类型作为参数传递 在方法体中来回赋值会创建新的对象 和原本的没关系
        x = y;
        x.append(y);
        y = x;
    }
}

